package com.igeek.javase.list.test;

import java.util.Objects;

/**
 * @author chenmin
 * 2023/7/18 0:31
 * @description TODO
 */
public class User {
    private String name;
    private String code;


    public User() {
    }

    public User(String name, String code) {
        this.name = name;
        this.code = code;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return code
     */
    public String getCode() {
        return code;
    }

    /**
     * 设置
     * @param code
     */
    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(name, user.name) && Objects.equals(code, user.code);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, code);
    }

    public String toString() {
        return "User{name = " + name + ", code = " + code + "}";
    }
}
